import { defAxios as request } from '@/utils/http'

/**
 * 报告 分页查询
 * @returns
 */
export const getReportList = params => request({
  url: '/inspection/page/list',
  method: 'GET',
  params
})

/**
 * 巡检报告详情
 * @param {*} params id
 * @returns
 */
export const getReportDetail = params => request({
  url: `/report/inspection/${params}`,
  method: 'GET'
})

/**
 * 处理报告详情
 * @param {*} params id
 * @returns
 */
export const getReportHandleDetail = params => request({
  url: `/report/inspection/handle/${params}`,
  method: 'GET'
})

/**
 * 生成报告
 * @param {*} params
 * @returns
 */
export const reportGenerate = data => request({
  url: '/report/generate/' + data,
  method: 'POST'
})

/**
 * 导出巡检报告
 * @param {*} params id
 * @returns
 */
export const exportReport = params => request({
  url: `/report/export/inspection/${params}`,
  method: 'GET',
  responseType: 'arraybuffer'
})

/**
 * 导出巡检处理报告
 * @param {*} params id
 * @returns
 */
export const exportReportHandle = params => request({
  url: `/report/export/inspection/handle/${params}`,
  method: 'GET',
  responseType: 'arraybuffer'
})
